/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unc.pds.facets;

import java.rmi.RemoteException;
import unc.pds.model.Newsable;
import unc.pds.model.UserRemote;
import unc.pds.service.ServiceBeanRemote;

/**
 *
 * @author Mikhail
 */
public class ShortNewsFacet implements Facet {
    public ShortNewsFacet(UserRemote obj, ServiceBeanRemote service) {
        this.obj = obj;
        this.service = service;
    }
    UserRemote obj;
    ServiceBeanRemote service;
    public String draw() throws RemoteException {
        String result = "";
        result += "<h4>Новости:</h4>";
        result += NewsDrawer.drawNews(obj.getNews(), service, 5);
        result += "<p><a href=\"index.jsp?id="+obj.getKey()+"&view=news\">Больше...</a></p>";
        return result;
    }
    public boolean isSide() {
        return true;
    }
}
